<template>
    <div class="water-indicator-container">
        <div class="water-indicator" :style="{ '--completion': completion + '%' }"></div>
        <span class="water-result">{{ completion }}</span>
        <input class="water-range" type="range"  min="0" max="100" v-model="completion">
    </div>
</template>

<script>
export default {
    name: "WaterIndicator",
    data() {
        return {
            completion: 0,
        }
    },
}
</script>

<style scoped>
.water-indicator-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.water-indicator {
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-color: rgb(240, 245, 250);
    overflow: hidden;
}

.water-indicator::after {
    bottom: calc(-200% + var(--completion));
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    border-radius: 40%;
    background-color: rgb(128, 183, 232);
    animation: wave 5s linear infinite;
}

@keyframes wave {
    from {
        transform: rotateZ(0deg);
    }

    to {
        transform: rotateZ(360deg);
    }
}

.water-result {
    font-size: 1.5rem;
    color: rgb(12, 12, 12);
    position: absolute;
}

.water-range {
    position: relative;
    top: 70px;
}
</style>
